<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="<%=request.getContextPath() %>/static/common/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath() %>/static/common/js/jquery.js"></script>

<script type="text/javascript">
	
</script>


</head>


<body>

	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    <li><a href="#">学员模块</a></li>
    <li><a href="#">错题信息</a></li>
    </ul>
    </div>
    
    <div class="rightinfo">
    
    <div class="tools">
    
      <input type ="text" />
      <form id="condition" name = "condition" action="" method ="post">  
	        <ul class="toolbar">
	        	<li>题目<input type="text" name="questionName" value="${questionName }" onblur="setPageNo(1);" style="height:30px;vertical-align:middle;line-height:27px;margin-left:15px;"/></li>
	        	<li>题型
	        		<select name="questionType" onchange="setPageNo(1);">
	        			<option <c:if test="${empty questionType }">selected=selected</c:if>>-全部-</option>
	        			<option <c:if test="${questionType == '1' }">selected=selected</c:if>>单选题</option>
	        			<option <c:if test="${questionType == '2' }">selected=selected</c:if>>多选题</option>
	        			<option <c:if test="${questionType == '3' }">selected=selected</c:if>>判断题</option>
	        		</select>
	        	</li>
	        	<li>难度
	        		<select name="difficulty" onchange="setPageNo(1);">
	        			<option <c:if test="${empty difficulty }">selected=selected</c:if>>-全部-</option>
	        			<option <c:if test="${difficulty == '1' }">selected=selected</c:if>>低</option>
	        			<option <c:if test="${difficulty == '2' }">selected=selected</c:if>>中</option>
	        			<option <c:if test="${difficulty == '3' }">selected=selected</c:if>>较高</option>
	        			<option <c:if test="${difficulty == '4' }">selected=selected</c:if>>高</option>
	        		</select>
	        	</li>
	        </ul>
      </form>
        
        <ul class="toolbar1">
        <li><span><img src="<%=request.getContextPath() %>/static/common/images/t05.png" /></span>设置</li>
        </ul>
    
    </div>
    
    
    <table class="tablelist">
    	
    	<c:forEach items="${pageModel.list }" var="errorQuestion" varStatus="v">
	    	<tr>
	        <th>${v.count }、${errorQuestion.question }&nbsp;&nbsp;&nbsp;
	        	<c:if test="${errorQuestion.answer == '1' }">
	        		<span style="color:blue;display: inline;">正确答案：√</span>
	        	</c:if>
	        	<c:if test="${errorQuestion.answer == '2' }">
	        		<span style="color:blue;display: inline;">正确答案：×</span>
	        	</c:if>
	        	<c:if test="${errorQuestion.answer != '1' && errorQuestion.answer != '2' }">
	        		<span style="color:blue;display: inline;">正确答案：${errorQuestion.answer }</span>
	        	</c:if>
	        	
	        	<c:if test="${errorQuestion.error_answer == '1' }">
	        		<span style="color:red;display: inline;">错选答案：√</span>
	        	</c:if>
	        	<c:if test="${errorQuestion.error_answer == '2' }">
	        		<span style="color:red;display: inline;">错选答案：√</span>
	        	</c:if>
	        	<c:if test="${errorQuestion.error_answer != '1' && errorQuestion.error_answer != '2' }">
	        		<span style="color:red;display: inline;">错选答案：${errorQuestion.error_answer }</span>
	        	</c:if>
	        	
	        	<%-- <span style="color:red;display: inline;">错选答案：${errorQuestion.error_answer }</span> --%>
	        </th>
	        </tr>
	        <c:if test="${!empty errorQuestion.answerA}">
		        <tr>
		        <th colspan="3">A、${errorQuestion.answerA }</th>
		      
		        </tr>
	      
	        	 <tr>
		        <th colspan="3">B、${errorQuestion.answerB }</th>
		      
		        </tr>
		        <tr>
		        <th colspan="3">C、${errorQuestion.answerC }</th>
		      
		        </tr>
		         <tr>
		        <th colspan="3">D、${errorQuestion.answerD }</th>
		      
		        </tr>
	        </c:if>
        </c:forEach>
    </table>
    
   
    <div class="pagin">
    	<div class="message">共<i class="blue">${pageModel.allRecords }</i>条记录，共<i class="blue">${pageModel.totalPage }页</i>，当前显示第&nbsp;<i class="blue">${pageModel.pageNo }&nbsp;</i>页</div>
    	<form action="" method="post">
	        <ul class="paginList">
		        <li class="paginItem"><a href="javascript:setPageNo(${pageModel.first });">首页</a></li>
		        <li class="paginItem"><a href="javascript:setPageNo(${pageModel.pre });"><span class="pagepre"></span></a></li>
		        
		        	<c:if test="${pageModel.totalPage <= 7 }">
		        		<c:forEach varStatus="status" begin="1" end="${pageModel.totalPage}" step="1">
		        			<c:if test="${status.count == pageModel.pageNo}">
		        				<li class="paginItem" style="background:blue;"><a href="javascript:setPageNo(${status.count});">${status.count}</a></li>
		        			</c:if>
		        			<c:if test="${status.count != pageModel.pageNo}">
		        				<li class="paginItem"><a href="javascript:setPageNo(${status.count});">${status.count}</a></li>
		        			</c:if>
		        		</c:forEach>
		        	</c:if>
		        	
		        	<%-- <c:if test="${pageModel.totalPage > 7 && pageModel.pageNo >= 4}">
		        		<c:forEach varStatus="status" begin="1" end="5" step="1">
		        			<li class="paginItem"><a href="javascript:;">${status.count}</a></li>
		        		</c:forEach>
		        		<li class="paginItem"><a href="javascript:;">...</a></li>
		        		<li class="paginItem"><a href="javascript:;">${pageModel.totalPage}</a></li>
		        	</c:if> --%>
		        
		        
		        <li class="paginItem"><a href="javascript:setPageNo(${pageModel.next });"><span class="pagenxt"></span></a></li>
		        <li class="paginItem"><a href="javascript:setPageNo(${pageModel.last });">尾页</a></li>
	        </ul>
        </form>
    </div>
         
    <br/>
    
    </div>
   <script>
   	
   		function setPageNo(pageNo){
   			
   			document.condition.action="<%=request.getContextPath()%>/StudentServlet?command=error_questions&pageNo="+pageNo;
   			document.condition.submit();
   		}
   
   </script>

</body>

</html>
